package api03a;


import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;

public class SortPoint {
    public static void main(String[] args) {
        List<Point> list = new ArrayList<>();
        list.add(new Point(4,4));
        list.add(new Point(3,1));
        list.add(new Point(5,2));
        list.add(new Point(1,1));
        System.out.println(list);

        Collections.sort(list,(a1,a2)->a1.getX()-a2.getX());
        System.out.println(list);



    }
}
